home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / python2.4 / site-packages / NumTut / mkpic.py < prev    next >
Text File  |  2006-01-20  |  288b  |  10 lines

  1. import Image
  2. import Numeric
  3. import pickle
  4. g = Image.open('greece.jpg')
  5. greeceRGB = Numeric.fromstring(g.tostring(), 'b')
  6. greeceRGB.shape = (724, 1065, 4)
  7. greeceRGB = greeceRGB[::-3,::3,:3]
  8. greeceRGB = Numeric.transpose(greeceRGB, (1,0,2))
  9. pickle.dump(greeceRGB, open('greece.pik', 'wb'))
  10.